<?php
class StockController extends CController
{

	public function actions()
	{
		return array(
				'quote'=>array(
						'class'=>'CWebServiceAction',
				),
		);
	}


	/**
	 * @param string the symbol of the stock
	 * @return float the stock price
	 * @soap
	 */
	public function getPrice($symbol)
	{
		$prices=array('IBM'=>100, 'GOOGLE'=>350);
		return isset($prices[$symbol])?$prices[$symbol]:0;
		//...return stock price for $symbol
	}

	public function actionGetPrice($symbol)
	{
		header('Content-type: application/json');
		$prices=array('IBM'=>100, 'GOOGLE'=>350);
		$salida = isset($prices[$symbol])?$prices[$symbol]:0;
		echo CJSON::encode($salida);
		Yii::app()->end();
	}
}


?>